package main

func camelMatch(queries []string, pattern string) []bool {
	result := make([]bool, len(queries))
	for i := 0; i < len(queries); i++ {
		query := queries[i]

		qI, pI := 0, 0

		for qI < len(query) && pI < len(pattern) {
			if query[qI] == pattern[pI] {
				qI++
				pI++
				continue
			}

			if query[qI] != pattern[pI] {
				if query[qI] >= 'A' && query[qI] <= 'Z' {
					break
				}
				qI++
			}
		}

		isNotEqual := false
		for qI < len(query) {
			if query[qI] >= 'A' && query[qI] <= 'Z' {
				isNotEqual = true
				break
			}
		}

		if !isNotEqual && pI == len(pattern) {
			result[i] = true
		}
	}

	return result
}
